<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
    

    

    



    <meta charset="utf-8">
    
    
    <meta name="sogou_site_verification" content="true">
    
    
    
    <title>后端开发面试分享 | Lvshen&#39;s Blog | This is My World</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content>
    <meta name="baidu-site-verification" content="VIVNdSiMZm">
    <meta name="description" content="前段时间面试了几家公司，现在把面试经历写出来。和大家一起分享。为了隐私，面试公司打码。                                                                                              面试">
<meta property="og:type" content="article">
<meta property="og:title" content="后端开发面试分享">
<meta property="og:url" content="https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/index.html">
<meta property="og:site_name" content="Lvshen&#39;s Blog">
<meta property="og:description" content="前段时间面试了几家公司，现在把面试经历写出来。和大家一起分享。为了隐私，面试公司打码。                                                                                              面试">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://s1.ax1x.com/2020/07/01/NHpkz4.md.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/04/17/JV7bCt.png">
<meta property="og:updated_time" content="2020-07-01T13:44:58.282Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="后端开发面试分享">
<meta name="twitter:description" content="前段时间面试了几家公司，现在把面试经历写出来。和大家一起分享。为了隐私，面试公司打码。                                                                                              面试">
<meta name="twitter:image" content="https://s1.ax1x.com/2020/07/01/NHpkz4.md.jpg">
    
    <link rel="shortcut icon" href="/img/mylogo.jpg">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">我的技术小房间</h5>
          <a href="mailto:https://lvshen9.github.io" title="https://lvshen9.github.io" class="mail">https://lvshen9.github.io</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                Archives
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                Tags
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                Categories
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/about"  >
                <i class="icon icon-lg icon-address-book"></i>
                About
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/collection"  >
                <i class="icon icon-lg icon-apple"></i>
                Collection
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://lvshen9.github.io/" target="_blank" >
                <i class="icon icon-lg icon-wordpress"></i>
                Blog
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/lvshen9" target="_blank" >
                <i class="icon icon-lg icon-github-alt"></i>
                GitHub
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">后端开发面试分享</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">后端开发面试分享</h1>
        <h5 class="subtitle">
            
                <time datetime="2020-07-01T12:55:52.000Z" itemprop="datePublished" class="page-time">
  2020-07-01
</time>


            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#米科技"><span class="post-toc-number">1.</span> <span class="post-toc-text">*米科技</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">一面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#二面"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">二面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#三面"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">三面</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#中-谷"><span class="post-toc-number">2.</span> <span class="post-toc-text">中**谷</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面-1"><span class="post-toc-number">2.1.</span> <span class="post-toc-text">一面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#二面-1"><span class="post-toc-number">2.2.</span> <span class="post-toc-text">二面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#三面-1"><span class="post-toc-number">2.3.</span> <span class="post-toc-text">三面</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#中-讯"><span class="post-toc-number">3.</span> <span class="post-toc-text">中**讯</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面-2"><span class="post-toc-number">3.1.</span> <span class="post-toc-text">一面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#二面-2"><span class="post-toc-number">3.2.</span> <span class="post-toc-text">二面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#三面-2"><span class="post-toc-number">3.3.</span> <span class="post-toc-text">三面</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#华-技术"><span class="post-toc-number">4.</span> <span class="post-toc-text">华*技术</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面-3"><span class="post-toc-number">4.1.</span> <span class="post-toc-text">一面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#二面-3"><span class="post-toc-number">4.2.</span> <span class="post-toc-text">二面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#三面-3"><span class="post-toc-number">4.3.</span> <span class="post-toc-text">三面</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#杭-猫"><span class="post-toc-number">5.</span> <span class="post-toc-text">杭**猫</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面-4"><span class="post-toc-number">5.1.</span> <span class="post-toc-text">一面</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#三-集团"><span class="post-toc-number">6.</span> <span class="post-toc-text">三*集团</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面-5"><span class="post-toc-number">6.1.</span> <span class="post-toc-text">一面</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#腾-云"><span class="post-toc-number">7.</span> <span class="post-toc-text">腾*云</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面-6"><span class="post-toc-number">7.1.</span> <span class="post-toc-text">一面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#二面-4"><span class="post-toc-number">7.2.</span> <span class="post-toc-text">二面</span></a></li></ol></li><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#中国"><span class="post-toc-number">8.</span> <span class="post-toc-text">中国**</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#一面-7"><span class="post-toc-number">8.1.</span> <span class="post-toc-text">一面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#二面-5"><span class="post-toc-number">8.2.</span> <span class="post-toc-text">二面</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#三面-4"><span class="post-toc-number">8.3.</span> <span class="post-toc-text">三面</span></a></li></ol></li></ol>
        </nav>
    </aside>


<article id="post-后端开发面试分享"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">后端开发面试分享</h1>
        <div class="post-meta">
            <time class="post-time" title="2020-07-01 20:55:52" datetime="2020-07-01T12:55:52.000Z"  itemprop="datePublished">2020-07-01</time>

            


            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p>前段时间面试了几家公司，现在把面试经历写出来。和大家一起分享。为了隐私，面试公司打码。</p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="https://s1.ax1x.com/2020/07/01/NHpkz4.md.jpg" alt="面试" title>
                </div>
                <div class="image-caption">面试</div>
            </figure>
<a id="more"></a>
<h4 id="米科技"><a href="#米科技" class="headerlink" title="*米科技"></a>*米科技</h4><h5 id="一面"><a href="#一面" class="headerlink" title="一面"></a>一面</h5><p><strong>1.HashMap源码，怎么线程不安全，ConcurrentHashMap 怎么保证线程安全，与1.7的不同，CAS是什么</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">HashMap:</span><br><span class="line">数组+ 链表 + 红黑树</span><br><span class="line">初始长度 = 16</span><br><span class="line">扩容因子 = 0.75</span><br><span class="line">index  = hashCode(key) % length</span><br><span class="line">hashCode(key) 高8位与低8位异或 &amp; (length - 1)</span><br><span class="line">ConcurrentHashMap:</span><br><span class="line">1.7 分段锁 Segament 用的Lock可重入锁</span><br><span class="line">1.8 每个node节点有锁 cas + synchronized</span><br></pre></td></tr></table></figure>
<p><strong>2.AQS知道是啥么</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">同步阻塞队列， 采用CAS，自旋，LockSupport.park()</span><br><span class="line"></span><br><span class="line">CountDownLatch </span><br><span class="line">CyclicBarrier </span><br><span class="line">Semaphore</span><br></pre></td></tr></table></figure>
<p><strong>3.线程池原理?，如果创建的线程满了，该怎么做，淘汰机制有没有了解？</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">仓库；阻塞队列，放任务的</span><br><span class="line">线程集合</span><br><span class="line">线程重仓库里面拿任务 放到 cpu 执行运算</span><br></pre></td></tr></table></figure>
<p><strong>4.索引优化，最左原则是什么？原理知不知道；（id name age）组合索引     where id = ,name = , age&gt; 索引失效么。你怎么看explain执行计划</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">1、在MySQL中，进行条件过滤时，是按照向右匹配直到遇到范围查询（&gt;,&lt;,between,like）就停止匹配，比如说a = 1 and b = 2 and c &gt; 3 and d = 4 如果建立(a, b, c, d)顺序的索引，d是用不到索引的，如果建立(a, b, d, c)索引就都会用上，其中a，b，d的顺序可以任意调整。</span><br><span class="line"></span><br><span class="line">2、= 和 in 可以乱序，比如 a = 1 and b = 2 and c = 3 建立(a, b, c)索引可以任意顺序，MySQL的查询优化器会优化索引可以识别的形式。</span><br></pre></td></tr></table></figure>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="https://s1.ax1x.com/2020/04/17/JV7bCt.png" alt="示例" title>
                </div>
                <div class="image-caption">示例</div>
            </figure>
<p><strong>5.怎么找到最大 age的数值。</strong></p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">--索引失效SELECT MAX(`code`) from member</span></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> * <span class="keyword">FROM</span> <span class="keyword">member</span> <span class="keyword">WHERE</span> code = (<span class="keyword">SELECT</span> <span class="keyword">MAX</span>(<span class="string">`code`</span>) <span class="keyword">from</span> <span class="keyword">member</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">--两个 表的查询都不是失效</span></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> * <span class="keyword">FROM</span> <span class="keyword">member</span> <span class="keyword">WHERE</span> code = (<span class="keyword">SELECT</span> <span class="string">`code`</span> <span class="keyword">FROM</span> <span class="keyword">member</span> <span class="keyword">ORDER</span> <span class="keyword">BY</span> <span class="string">`code`</span> <span class="keyword">DESC</span> <span class="keyword">LIMIT</span> <span class="number">1</span>);</span><br></pre></td></tr></table></figure>
<p><strong>5.技术困难，怎么解决。</strong></p>
<p>集群部署中间件，开发业务上的困难：电商平台</p>
<p><strong>6.前公司开发团队规模。负责模块</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">**人。新零售**开发</span><br></pre></td></tr></table></figure>
<p><strong>7.怎么保证Kafka消息的顺序性，Kafka消费端数据不丢失</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">消费者获取到数据后，按key hash分发，相同的到同一个队列，用一个线程去获取队列，传到数据库中</span><br><span class="line"></span><br><span class="line">加大kafka数据保留时间，重新往消费者里面发送一条数据，手动提交offset，保证消费端业务完成消费在提交。</span><br></pre></td></tr></table></figure>
<p><strong>8.你们公司本地缓存 用Redis 发布/订阅删除KEY,如果通知失败，怎么办</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">应该有重试机制，具体我不清楚</span><br></pre></td></tr></table></figure>
<p>9.个人在公司水平</p>
<p><strong>10.AQS</strong>组件：<code>CountDownLatch</code>，<code>CyclicBarrier</code>区别</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">CountDownLatch：一个线程等待多个线程执行完后才能执行</span><br><span class="line">CyclicBarrier：多个线程互相等待</span><br></pre></td></tr></table></figure>
<p><strong>11.如果有个线程4，要等前面线程1，2，3都执行完才能执行，你要怎么做。</strong></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br></pre></td><td class="code"><pre><span class="line">用上面两个类实现（共享锁）</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * Description:倒计数器</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author</span> Lvshen</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@version</span> 1.0</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@date</span>: 2020/4/16 14:28</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@since</span> JDK 1.8</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">CountDownLatchDemo</span> </span>&#123;</span><br><span class="line">    <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">int</span> COUNT = <span class="number">20</span>;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">static</span> CountDownLatch cdl = <span class="keyword">new</span> CountDownLatch(COUNT);</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">        <span class="keyword">new</span> Thread(<span class="keyword">new</span> Teacher(cdl)).start();</span><br><span class="line">        Thread.sleep(<span class="number">1</span>);</span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; COUNT; i++) &#123;</span><br><span class="line">            <span class="keyword">new</span> Thread(<span class="keyword">new</span> Student(i, cdl)).start();</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">synchronized</span> (CountDownLatchDemo<span class="class">.<span class="keyword">class</span>) </span>&#123;</span><br><span class="line">            CountDownLatchDemo<span class="class">.<span class="keyword">class</span>.<span class="title">wait</span>()</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">static</span> <span class="class"><span class="keyword">class</span> <span class="title">Teacher</span> <span class="keyword">implements</span> <span class="title">Runnable</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">        CountDownLatch cdl;</span><br><span class="line"></span><br><span class="line">        Teacher(CountDownLatch cdl) &#123;</span><br><span class="line">            <span class="keyword">this</span>.cdl = cdl;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="meta">@Override</span></span><br><span class="line">        <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line">            System.out.println(<span class="string">"老师发卷子。。。"</span>);</span><br><span class="line">            <span class="keyword">try</span> &#123;</span><br><span class="line">                cdl.await();</span><br><span class="line">            &#125; <span class="keyword">catch</span> (InterruptedException e) &#123;</span><br><span class="line">                e.printStackTrace();</span><br><span class="line">            &#125;</span><br><span class="line">            System.out.println(<span class="string">"老师收卷子。。。"</span>);</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">static</span> <span class="class"><span class="keyword">class</span> <span class="title">Student</span> <span class="keyword">implements</span> <span class="title">Runnable</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">        CountDownLatch cdl;</span><br><span class="line">        <span class="keyword">int</span> num;</span><br><span class="line"></span><br><span class="line">        Student(<span class="keyword">int</span> num, CountDownLatch cdl) &#123;</span><br><span class="line">            <span class="keyword">this</span>.num = num;</span><br><span class="line">            <span class="keyword">this</span>.cdl = cdl;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="meta">@Override</span></span><br><span class="line">        <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line">            System.out.println(String.format(<span class="string">"学生(%s)写卷子。。。"</span>,num));</span><br><span class="line">            <span class="comment">//doingLongTime();</span></span><br><span class="line">            <span class="keyword">try</span> &#123;</span><br><span class="line">                Thread.sleep(<span class="number">2000</span>);</span><br><span class="line">            &#125; <span class="keyword">catch</span> (InterruptedException e) &#123;</span><br><span class="line">                e.printStackTrace();</span><br><span class="line">            &#125;</span><br><span class="line">            System.out.println(String.format(<span class="string">"学生(%s)写卷子。。。"</span>,num));</span><br><span class="line">            cdl.countDown();</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">ConcurrentTestDemo</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">        <span class="comment">//并发数</span></span><br><span class="line">        <span class="keyword">int</span> currency = <span class="number">20</span>;</span><br><span class="line"></span><br><span class="line">        <span class="comment">//循环屏障</span></span><br><span class="line">        CyclicBarrier cyclicBarrier = <span class="keyword">new</span> CyclicBarrier(currency);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; currency; i++) &#123;</span><br><span class="line">            <span class="keyword">new</span> Thread(() -&gt; &#123;</span><br><span class="line">                OrderServiceImplWithDisLock orderService = <span class="keyword">new</span> OrderServiceImplWithDisLock();</span><br><span class="line">                System.out.println(Thread.currentThread().getName() + <span class="string">"====start===="</span>);</span><br><span class="line">                <span class="comment">//等待一起出发</span></span><br><span class="line">                <span class="keyword">try</span> &#123;</span><br><span class="line">                    cyclicBarrier.await();</span><br><span class="line">                &#125; <span class="keyword">catch</span> (InterruptedException | BrokenBarrierException e) &#123;</span><br><span class="line">                    e.printStackTrace();</span><br><span class="line">                &#125;</span><br><span class="line">                orderService.createOrder();</span><br><span class="line">            &#125;).start();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h5 id="二面"><a href="#二面" class="headerlink" title="二面"></a>二面</h5><p><strong>1.你这个<code>Log4X</code>系统怎么增量采集日志的</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">这个我只是部署，并没有参与开发</span><br><span class="line"></span><br><span class="line">那你有没有想过这个问题？</span><br><span class="line">。。。</span><br></pre></td></tr></table></figure>
<p><strong>2.你怎么理解并发，为什么要用多线程</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">极限压榨CPU，加快执行数度</span><br></pre></td></tr></table></figure>
<p><strong>3.<code>i++</code>要线程安全，你有几种方法，这几种哪种性能最好</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">volatile + sychronized/lock.lock , AtomicInteger</span><br><span class="line">高并发下lock.lock性能要好，atomicInteger.incrementAndGet()我不知道新能怎么么样，我只知道底层用了CAS，lock.lock底层也用了CAS</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">VolatileAtomicTest</span> </span>&#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">volatile</span> <span class="keyword">int</span> num = <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">synchronized</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">increase</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        num++;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> <span class="keyword">throws</span> InterruptedException </span>&#123;</span><br><span class="line">        Thread[] threads = <span class="keyword">new</span> Thread[<span class="number">10</span>];</span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; threads.length; i++) &#123;</span><br><span class="line">            threads[i] = <span class="keyword">new</span> Thread(() -&gt; &#123;</span><br><span class="line">                <span class="keyword">for</span> (<span class="keyword">int</span> j = <span class="number">0</span>; j &lt; <span class="number">1000</span>; j++) &#123;</span><br><span class="line">                    increase();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;);</span><br><span class="line"></span><br><span class="line">            threads[i].start();</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">for</span> (Thread thread : threads) &#123;</span><br><span class="line">            thread.join();</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        System.out.println(num);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>4.<code>synchronized</code>与<code>Lock</code>的区别</strong></p>
<p>详情可阅读我的博客：<a href="https://lvshen9.gitee.io/2020/04/11/1/">Java锁</a></p>
<p><strong>5.手写单列模式</strong></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">LazySimpleSingleton</span> </span>&#123;</span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">volatile</span> LazySimpleSingleton instance = <span class="keyword">null</span>;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">private</span> <span class="title">LazySimpleSingleton</span><span class="params">()</span></span>&#123;</span><br><span class="line">        <span class="keyword">if</span> (instance != <span class="keyword">null</span>) &#123;</span><br><span class="line">            <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"该构造方法禁止获取"</span>);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> LazySimpleSingleton <span class="title">getInstance</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">if</span> (instance == <span class="keyword">null</span>) &#123;</span><br><span class="line">            <span class="keyword">synchronized</span> (LazySimpleSingleton<span class="class">.<span class="keyword">class</span>) </span>&#123;</span><br><span class="line">                <span class="keyword">if</span> (instance == <span class="keyword">null</span>) &#123;</span><br><span class="line">                    instance = <span class="keyword">new</span> LazySimpleSingleton();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> instance;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><strong>6.你用过xxl-job分布式任务调度系统，你知道底层怎么实现的么，怎么确保任务不被重复执行，知不知道他的失败重试机制</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">quartz定时器</span><br><span class="line">一致性：“调度中心”通过DB锁保证集群分布式调度的一致性, 一次任务调度只会触发一次执行；</span><br><span class="line">任务失败重试：支持自定义任务失败重试次数，当任务失败时将会按照预设的失败重试次数主动进行重试；</span><br><span class="line">这个我只会用，底层没有去看过</span><br></pre></td></tr></table></figure>
<p><strong>7.<code>Redis</code>分布式锁底层怎么实现</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">1. setnx + 过期时间 用lua脚本保证原子性</span><br><span class="line"></span><br><span class="line">2. 锁持有心跳检测（防止未解锁，锁失效问题）</span><br><span class="line"></span><br><span class="line">3. 线程自选获取锁</span><br><span class="line"></span><br><span class="line">Redisson框架已有实现</span><br></pre></td></tr></table></figure>
<p><strong>8.有没有处理过缓存雪崩，缓存穿透的场景</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">知道出现原因以及处理办法，但前公司并发不高，并由出现这类场景</span><br></pre></td></tr></table></figure>
<p><strong>9.雪花算法，原理知道吗，有没有缺点。</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ip + 端口 + 时间戳   跟机器时间有关，如果机器时间回调，会重复的吧</span><br></pre></td></tr></table></figure>
<p><strong>10.创建索引时，你要考虑哪些因素</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">主键 自增，要int类型，不要频繁修改。索引不是越多越好，前公司要求最多5个索引，以常用查询字段建立索引</span><br></pre></td></tr></table></figure>
<h5 id="三面"><a href="#三面" class="headerlink" title="三面"></a>三面</h5><p>1.你对996怎么看</p>
<p>2.你之前的公司为什么辞职</p>
<p>3.之前的公司是做什么的</p>
<h4 id="中-谷"><a href="#中-谷" class="headerlink" title="中**谷"></a>中**谷</h4><h5 id="一面-1"><a href="#一面-1" class="headerlink" title="一面"></a>一面</h5><p>1.最近的项目，用到哪些技术</p>
<p>2.js里面 == 和===区别</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">== 内容相等</span><br><span class="line">=== 内容和类型都要相等</span><br></pre></td></tr></table></figure>
<p>3.Linux中怎么看日志，怎么看进程，怎么看磁盘大小，怎么看内存大小</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">tail -f xx.log</span><br><span class="line">jps   / ps -ef | grep xx     /netstat -tnlp | grep xx</span><br><span class="line">du   /  df</span><br><span class="line">free</span><br></pre></td></tr></table></figure>
<p>4.Spring事务  A，B           A调B A异常，B会回滚么</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">都会回滚</span><br></pre></td></tr></table></figure>
<p>5.如果接口慢，你会怎么优化</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">arthas查看调用链耗时</span><br><span class="line">看接口有没有远程调用，远程调用这个网络耗时要考虑进去</span><br><span class="line">调用的远程接口有没有问题，有问题的话，远程接口也需要优化</span><br><span class="line">方法中的代码有没有问题，比如，循环里面查库了，一个数据多次查库了，全表查询了</span><br><span class="line">sql有没有用到索引</span><br><span class="line">上面的检查都没问题，考虑使用缓存（读多写少用缓存，写多读少用队列）</span><br><span class="line">还可考虑数据库的主从，读写分离</span><br></pre></td></tr></table></figure>
<p>6.Mybatis中 #{} 与 ${}的区别</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">#&#123;&#125;防止注入</span><br><span class="line">order by 需要用$&#123;&#125; $&#123;&#125; = &apos;1&apos;</span><br></pre></td></tr></table></figure>
<p>7.MySQL explain执行计划理解</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">system &gt; const &gt; eq_ref &gt; ref &gt; fulltext &gt; ref_or_null &gt; index_merge &gt; unique_subquery &gt; index_subquery &gt; range &gt; index &gt; ALL </span><br><span class="line"></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> * <span class="keyword">from</span> <span class="keyword">member</span> <span class="keyword">ORDER</span> <span class="keyword">BY</span> <span class="keyword">id</span>;    <span class="comment">#index</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> * <span class="keyword">from</span> <span class="keyword">member</span> <span class="keyword">WHERE</span> code &lt; <span class="number">100</span> <span class="keyword">and</span> code &lt;<span class="number">120</span>;  <span class="comment">#range</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> * <span class="keyword">from</span> <span class="keyword">member</span> <span class="keyword">WHERE</span> <span class="keyword">name</span> &lt; <span class="string">'1'</span> <span class="keyword">and</span> <span class="keyword">name</span> &lt;<span class="string">'3'</span>;  <span class="comment">#range</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> * <span class="keyword">from</span> <span class="keyword">member</span> <span class="keyword">WHERE</span> code = <span class="string">'99'</span>;  <span class="comment">#ref</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> <span class="keyword">id</span> <span class="keyword">from</span> <span class="keyword">member</span> <span class="keyword">WHERE</span> <span class="keyword">name</span> = <span class="string">'99'</span>;  <span class="comment">#ref</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">EXPLAIN</span> <span class="keyword">SELECT</span> * <span class="keyword">from</span> <span class="keyword">member</span> <span class="keyword">WHERE</span> <span class="keyword">id</span> = <span class="string">'1'</span>;  <span class="comment">#const</span></span><br></pre></td></tr></table></figure>
<p>8.char_length() 与length()区别，MySQL中</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">char_length() : 一般判断中文长度</span><br><span class="line">length() : 一般判断英文长度</span><br></pre></td></tr></table></figure>
<p>9.Spring中 @Autowired与@Resource区别</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">@Autowired：注入                spring自己的注解</span><br><span class="line">@Resource：可以自定义bean名称</span><br></pre></td></tr></table></figure>
<p>10.有没有自己部署MySQL，Redis。对里面的设置有做优化么</p>
<p>11.开启了两个事务，a事务里面作修改未提交，b事务里面做新增会怎样。</p>
<p>12.ConcurrentHashMap底层实现，以及与1.7有什么不同</p>
<h5 id="二面-1"><a href="#二面-1" class="headerlink" title="二面"></a>二面</h5><p>1.你们微服务调用链用的什么，skywalking怎么获取一条链路。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">请求的时候带上一个全局的id</span><br></pre></td></tr></table></figure>
<p>2.MySQL如果没有定义主键，会创建主键索引吗。有哪几种存储引擎</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Innodb</span><br><span class="line">MyIsam</span><br><span class="line"></span><br><span class="line">如果表没有创建主键，如果有唯一键，会用唯一键字段创建主键</span><br><span class="line">如果没有唯一键，则用一个隐式的rowid创建主键索引</span><br></pre></td></tr></table></figure>
<p>3.MySQL 回表知道是什么不。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">普通索引的叶子节点保存的主键的值，通过普通索引查询的值，还需要到主键索引中去查一遍，这就叫回表</span><br></pre></td></tr></table></figure>
<p>4.对架构的发展有没有了解，单体 -&gt; 分布式。</p>
<p>5.如果数据库并发请求多你会怎么做，有没有做过分库分表。</p>
<p>6.上家公司的开发流程。</p>
<p>7.上家公司工资</p>
<h5 id="三面-1"><a href="#三面-1" class="headerlink" title="三面"></a>三面</h5><p>1.看看你的博客，Volatile关键字原理你说一下，以及原子类的自增的介绍</p>
<p>2.线程与进程的区别，进程是CPU最小调度单位，这句话对吗</p>
<p>3.说说前公司项目开发流程，是不是敏捷开发。</p>
<p>4.说说前公司的架构，大概说一下</p>
<h4 id="中-讯"><a href="#中-讯" class="headerlink" title="中**讯"></a>中**讯</h4><h5 id="一面-2"><a href="#一面-2" class="headerlink" title="一面"></a>一面</h5><p>1.HashMap底层结构，ConcurrentHashMap底层结构</p>
<p>2.ThreadlLocal低层结构，弱引用与软引用区别</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">弱引用：GC一次，回收一次</span><br><span class="line">软引用：堆满了，会被GC掉</span><br></pre></td></tr></table></figure>
<p>3.线程池结构，怎么用的，任务满了，拒绝策略。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">ThreadPoolExecutor.AbortPolicy：抛出 RejectedExecutionException来拒绝新任务的处理。</span><br><span class="line">ThreadPoolExecutor.CallerRunsPolicy：调用执行自己的线程运行任务。您不会任务请求。但是这种策略会降低对于新任务提交速度，影响程序的整体性能。另外，这个策略喜欢增加队列容量。如果您的应用程序可以承受此延迟并且你不能任务丢弃任何一个任务请求的话，你可以选择这个策略。</span><br><span class="line">ThreadPoolExecutor.DiscardPolicy： 不处理新任务，直接丢弃掉。</span><br><span class="line">ThreadPoolExecutor.DiscardOldestPolicy： 此策略将丢弃最早的未处理的任务请求。</span><br></pre></td></tr></table></figure>
<p>4.Java虚拟机内存划分，GC回收算法。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">线程共享：堆，方法区</span><br><span class="line">线程独占：虚拟机栈，本地方法栈，程序计数器</span><br><span class="line"></span><br><span class="line">标记清除，标记复制法，标记整理法</span><br></pre></td></tr></table></figure>
<p>5.你多线程在哪里用到的。volitle关键字可见性原理知道么。</p>
<p>6.JUC并发包下面的类你知道有哪些么</p>
<p>7.Redis缓存注解你是怎么实现的，怎么用的AOP</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">在要缓存的方法上面添加注解，注解内要填一个参数：key</span><br><span class="line">实际就是利用AOP在有注解的方法前后插入了代码</span><br><span class="line">缓存的原理为；</span><br><span class="line">先去缓存中查找值；有值，直接返回；没有值，取数据库中查询，将值存入缓存中，返回值</span><br></pre></td></tr></table></figure>
<p>8.Redis分布式锁细节，怎么保证redis主从一直性，与Zookeeper分布式锁的区别</p>
<p>9.你怎么优化系统的，加入并发很高的情况下。你有没有数据库层面的优化。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">缓存</span><br><span class="line">数据库读写分离</span><br><span class="line">流量削峰</span><br><span class="line">限流</span><br></pre></td></tr></table></figure>
<p>10.MySOL聚集索引和非聚集索引的区别，索引优化你怎么做的。innodb就一定是聚集索引么。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">聚集索引：叶子节点村的是数据</span><br><span class="line">非聚集索引：叶子节点存的是数据的地址</span><br></pre></td></tr></table></figure>
<p>11.SpringBoot你用到了哪些注解</p>
<p>12.MySQL默认事务隔离级别，以及事务隔离级别有哪些。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">未提交读</span><br><span class="line">已提交读</span><br><span class="line">可重复读 （Mysql默认）</span><br><span class="line">序列化</span><br></pre></td></tr></table></figure>
<p>13.限流原理怎么实现的</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Redis。然后利用单线程特性，使用Redisson的原子加。每调用接口一次，就会自增计数。</span><br></pre></td></tr></table></figure>
<p>14.Spring bean的生命周期</p>
<p>15.applicationContext与beanFactory的区别</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">两者都能获取bean</span><br><span class="line">beanFactory:懒加载，调用getBean是才实例化对象</span><br><span class="line">applicationContext:预加载，启用applicationContext就实例化对象了</span><br><span class="line"></span><br><span class="line">ApplicationContext 包含 BeanFactory 的所有特性，通常推荐使用前者。但是也有一些限制情形，比如移动应用内存消耗比较严苛，在那些情景中，使用更轻量级的 BeanFactory 是更合理的。然而，在大多数企业级的应用中，ApplicationContext 是你的首选。</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">HelloWorldApp</span> </span>&#123;</span><br><span class="line">        <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">            XmlBeanFactory factory = <span class="keyword">new</span> XmlBeanFactory(<span class="keyword">new</span> ClassPathResource(<span class="string">"beans.xml"</span>));</span><br><span class="line">            HelloWorld obj = (HelloWorld) factory.getBean(<span class="string">"helloWorld"</span>);</span><br><span class="line">            obj.getMessage();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">    ApplicationContext context = <span class="keyword">new</span> ClassPathXmlApplicationContext(<span class="string">"beans.xml"</span>);</span><br><span class="line">    HelloWorld obj = (HelloWorld) context.getBean(<span class="string">"helloWorld"</span>);</span><br><span class="line">    obj.getMessage();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>16.线程间数据共享怎么实现</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">Callable的call方法有返回值</span><br><span class="line">volatile关键字能实现线程变量的可见</span><br></pre></td></tr></table></figure>
<p>17.用多线程就一定好吗</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">不一定，线程数量要合适，一般为cpu核数的2倍。</span><br></pre></td></tr></table></figure>
<p>18.弱引用与软引用</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">弱引用：GC时会被回收掉</span><br><span class="line">软引用：内存满了会被回收掉</span><br></pre></td></tr></table></figure>
<p>19.Spring 动态代理</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">JDK动态代理：该代理类需要有接口</span><br><span class="line">CGLIB动态代理：通过生成代理类的子类来实现</span><br></pre></td></tr></table></figure>
<p>20.ThreadPoolExecutor参数</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">public ThreadPoolExecutor(int corePoolSize,</span><br><span class="line">                              int maximumPoolSize,</span><br><span class="line">                              long keepAliveTime,</span><br><span class="line">                              TimeUnit unit,</span><br><span class="line">                              BlockingQueue&lt;Runnable&gt; workQueue,</span><br><span class="line">                              ThreadFactory threadFactory,</span><br><span class="line">                              RejectedExecutionHandler handler) &#123;</span><br><span class="line">corePoolSize：核心线程数</span><br><span class="line">maximumPoolSize：最大线程数</span><br><span class="line">keepAliveTime：当没有任务时，多余核心线程数的线程存活时间</span><br></pre></td></tr></table></figure>
<h5 id="二面-2"><a href="#二面-2" class="headerlink" title="二面"></a>二面</h5><p>1.说说HashMap与Hashtable区别</p>
<p>2.你用AOP写过分布式缓存，你是怎么写的</p>
<p>3.接下来就是问性格，优缺点，爱好啥的了</p>
<h5 id="三面-2"><a href="#三面-2" class="headerlink" title="三面"></a>三面</h5><p>1.为什么换工作</p>
<p>2.之前有其他offer吗</p>
<p>3.你期望的工作环境是一个怎样的环境</p>
<h4 id="华-技术"><a href="#华-技术" class="headerlink" title="华*技术"></a>华*技术</h4><h5 id="一面-3"><a href="#一面-3" class="headerlink" title="一面"></a>一面</h5><p>1.你之前做什么的，你说的那个日志系统具体有哪些功能呢</p>
<p>2.你为什么用Redis锁分布式缓存呢，如果存在自己的map里面有什么问题</p>
<p>3.如果有10万条数据，需要导入到数据库，你觉得要考虑哪些问题</p>
<p>4.你们用的MySQL是怎么分页的，知道Oracle分页么。</p>
<p>5.现场手写一个冒泡排序</p>
<p>6.你觉得Mybatis和Hibernate有什么优缺点吗</p>
<p>7.常用数据结构有哪些</p>
<h5 id="二面-3"><a href="#二面-3" class="headerlink" title="二面"></a>二面</h5><p>1.你说说HashMap的原理</p>
<p>2.说说rRedis分布式锁你是怎么用的</p>
<p>3.说说zZookeeper可以用在哪些地方</p>
<p>4.讲讲你之前用的架构，为什么用微服务</p>
<p>5.你们怎么用Kafka实现分布式事务的</p>
<p>6.讲讲这个客服系统，表是怎么设计的</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">会话表</span><br><span class="line">客服表</span><br><span class="line">聊天记录表</span><br></pre></td></tr></table></figure>
<p>7.说说你知道哪些排序算法，比如二叉树排序知道吗</p>
<p>8.说说MySQL与Oracle有什么不同</p>
<h5 id="三面-3"><a href="#三面-3" class="headerlink" title="三面"></a>三面</h5><p>hr谈薪</p>
<h4 id="杭-猫"><a href="#杭-猫" class="headerlink" title="杭**猫"></a>杭**猫</h4><h5 id="一面-4"><a href="#一面-4" class="headerlink" title="一面"></a>一面</h5><p>1.项目难点，讲述下解决办法</p>
<p>2.二叉树与B + Tree区别</p>
<p>3.垃圾回收算法，判断垃圾算法，为什么会出现内存溢出</p>
<p>4.限流操作怎么操作</p>
<p>5.Semaphore底层</p>
<p>6.秒杀设计</p>
<p>7.内存溢出怎么排查</p>
<p>8.缓存雪崩解决</p>
<p>9.手写代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">//评测题目: 三个线程A、B、C，实现一个程序让线程A打印“A”，线程B打印“B”，线程C打印“C”，</span><br><span class="line">//三个线程输出ABCABCABC......ABC，循环10次“ABC”</span><br></pre></td></tr></table></figure>
<h4 id="三-集团"><a href="#三-集团" class="headerlink" title="三*集团"></a>三*集团</h4><h5 id="一面-5"><a href="#一面-5" class="headerlink" title="一面"></a>一面</h5><p>1.介绍下DDD领域驱动设计，是说的什么，里面分为哪些模块</p>
<p>2.设计模式分为哪种类</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">创建型模式，共五种：工厂方法模式、抽象工厂模式、单例模式、建造者模式、原型模式。</span><br><span class="line"></span><br><span class="line">结构型模式，共七种：适配器模式、装饰器模式、代理模式、外观模式、桥接模式、组合模式、享元模式。</span><br><span class="line"></span><br><span class="line">行为型模式，共十一种：策略模式、模板方法模式、观察者模式、迭代子模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式、中介者模式、解释器模式。</span><br></pre></td></tr></table></figure>
<p>3.接口幂等是如何实现的</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">每次调接口，去redis中查询是否有id号，没有生成，执行接口。有，说明执行过了，就不能执行了</span><br></pre></td></tr></table></figure>
<p>4.分布式锁怎么保证redis集群中，主库 -&gt; 同步数据到重库数据不丢失</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">保证同步成功给slave节点，才认为是加锁成功</span><br></pre></td></tr></table></figure>
<p>5.充血模型与贫血模型</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">充血模型：</span><br><span class="line">   除了getter/setter方法，还有一些功能性的方法</span><br><span class="line">贫血模型：</span><br><span class="line">   只有getter/setter方法</span><br></pre></td></tr></table></figure>
<h4 id="腾-云"><a href="#腾-云" class="headerlink" title="腾*云"></a>腾*云</h4><h5 id="一面-6"><a href="#一面-6" class="headerlink" title="一面"></a>一面</h5><p>1.写代码</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line">Description:给出有序数组(非递减)和闭区间, 找出数组中在区间之内的元素起始位置和结束位置</span><br><span class="line"> * 输入：</span><br><span class="line"> * <span class="number">1</span>. 有序数组[<span class="number">1</span>,<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>,<span class="number">5</span>,<span class="number">5</span>]</span><br><span class="line"> * <span class="number">2</span>. 闭区间[-<span class="number">3</span>,<span class="number">3</span>]</span><br><span class="line"> * 输出：[<span class="number">0</span>,<span class="number">3</span>]</span><br><span class="line"> * 解释：在数组中，前<span class="number">4</span>个元素在区间之内，则起始位置为<span class="number">0</span>，结束位置为<span class="number">3</span></span><br><span class="line"> * 要求：最坏情况时间复杂度小于O(n)</span><br><span class="line"> </span><br><span class="line"> 自己写的</span><br><span class="line"> <span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">TxTest</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">int</span>[] arrays = &#123;-<span class="number">10</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">5</span>&#125;;</span><br><span class="line">        fun1(arrays, -<span class="number">3</span>, <span class="number">3</span>);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">fun1</span><span class="params">(<span class="keyword">int</span>[] arrays, <span class="keyword">int</span> start, <span class="keyword">int</span> end)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">int</span> startIndex = startBound(arrays, start);</span><br><span class="line">        <span class="keyword">int</span> endIndex = endBound(arrays, end);</span><br><span class="line">        System.out.println(<span class="string">"["</span> + startIndex + <span class="string">","</span> + endIndex + <span class="string">"]"</span>);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">int</span> <span class="title">startBound</span><span class="params">(<span class="keyword">int</span>[] arrays, <span class="keyword">int</span> key)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">int</span> start = <span class="number">0</span>;</span><br><span class="line">        <span class="keyword">int</span> last = arrays.length;</span><br><span class="line">        <span class="keyword">while</span> (start &lt; last) &#123;</span><br><span class="line">            <span class="keyword">int</span> mid = (start + last) / <span class="number">2</span>;</span><br><span class="line">            <span class="keyword">if</span> (arrays[mid] &gt;= key) &#123;</span><br><span class="line">                last = mid;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                start = mid + <span class="number">1</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> start;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">int</span> <span class="title">endBound</span><span class="params">(<span class="keyword">int</span>[] arrays, <span class="keyword">int</span> key)</span> </span>&#123;</span><br><span class="line">        <span class="keyword">int</span> start = <span class="number">0</span>;</span><br><span class="line">        <span class="keyword">int</span> last = arrays.length;</span><br><span class="line">        <span class="keyword">while</span> (start &lt; last) &#123;</span><br><span class="line">            <span class="keyword">int</span> mid = (start + last) / <span class="number">2</span>;</span><br><span class="line">            <span class="keyword">if</span> (arrays[mid] &lt;= key) &#123;</span><br><span class="line">                start = mid + <span class="number">1</span>;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                last = mid;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> start - <span class="number">1</span>;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>
<p>2.红黑树和hash表的使用场景</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">Hash:</span><br><span class="line">hash表使用场景：bitmap的布隆过滤器使用的是hash表</span><br><span class="line">在那些需要一次一次遍历，去寻找元素的问题中，可以将问题转化为根据元素的内容去寻找索引，哈希表在这方面的时间效率是贼高的；</span><br><span class="line">在一些字符串词频统计问题、数独问题等问题中，可以利用哈希函数来计算某个元素出现的次数，作为算法的辅助工具；</span><br><span class="line">还有些问题，可以利用散列函数的思路，让几个不同的元素获得同样的结果，从而实现一个聚类。</span><br><span class="line"></span><br><span class="line">举个用于消息摘要例子，银行的数据库中是不能保存用户密码的原文的，只能保存密码的hash值。在这种应用场景里，对于抗碰撞和抗篡改能力要求极高，对速度的要求在其次。一个设计良好的hash算法，其抗碰撞能力是很高的。</span><br><span class="line"></span><br><span class="line">红黑树：</span><br><span class="line">epoll的事件管理模块</span><br><span class="line">Java中的TreeMap</span><br><span class="line">适用增删比较多的情况</span><br><span class="line">AVL适用查询比较多的情况</span><br><span class="line">相对于跳表，红黑树不适用与范围性的查找</span><br></pre></td></tr></table></figure>
<p>3.怎么查成绩第二的学生</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">-- 子查询索引没有失效</span><br><span class="line">EXPLAIN SELECT * FROM member m WHERE m.`code` = </span><br><span class="line">(SELECT m2.`code` FROM member m2 WHERE m2.`code` &lt; (SELECT m1.`code` FROM member m1 ORDER BY m1.`code` DESC LIMIT 1) ORDER BY m2.`code` DESC LIMIT 1);</span><br><span class="line"></span><br><span class="line">-- 使用max（）里面的子查询索引会失效</span><br><span class="line">EXPLAIN SELECT * FROM member m WHERE m.`code` = (SELECT MAX(m2.code) FROM member m2 WHERE m2.code &lt; (SELECT MAX(m1.code) FROM member m1));</span><br></pre></td></tr></table></figure>
<p>4.框架代码优化是做的什么</p>
<h5 id="二面-4"><a href="#二面-4" class="headerlink" title="二面"></a>二面</h5><p>1.Spring与SpringBoot的区别</p>
<p>2.SpringBoot中bootstrap.properties与application.properties的区别</p>
<p>3.zZookeeper底层结构，以及选举原理，集群最小数</p>
<p>4.Kafka为什么快，为什么不用其他消息中间件</p>
<p>5.SpringBoot除了做接口开发，还可以做什么开发</p>
<p>6.笔试题</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">写一个二分法查找算法</span><br></pre></td></tr></table></figure>
<h4 id="中国"><a href="#中国" class="headerlink" title="中国**"></a>中国**</h4><h5 id="一面-7"><a href="#一面-7" class="headerlink" title="一面"></a>一面</h5><p>1.AOP原理</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">切面编程，编译时期动态插入功能</span><br></pre></td></tr></table></figure>
<p>2.索引分类</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">主键索引，普通索引，唯一索引，联合索引</span><br></pre></td></tr></table></figure>
<p>3.B+Tree 与Hash的优缺点</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hash，单个查询最坏时间复杂度O（1），但是不能进行范围查询</span><br><span class="line">B+Tree，可以范围查询，能存更多的数据</span><br></pre></td></tr></table></figure>
<p>4.缓存雪崩，缓存穿透，缓存击穿</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">缓存雪崩：大量key同时失效，导致大量请求到了数据库，数据库崩溃，系统也就崩溃</span><br><span class="line">缓存穿透：不存在的key请求，也是请求入到了数据库</span><br><span class="line">缓存击穿：热点key失效</span><br></pre></td></tr></table></figure>
<p>5.限流怎么做的</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">redis 原子自增，每调用一次接口，自增一次，当计数大于指定数值时，限制不让调用接口</span><br></pre></td></tr></table></figure>
<h5 id="二面-5"><a href="#二面-5" class="headerlink" title="二面"></a>二面</h5><p>1.ES有用怎创建索引的么</p>
<p>2.开发的管理软件是做什么的</p>
<p>3.单体服务到微服务是怎发展的</p>
<p>4.虚拟机调优</p>
<p>5.类加载。内存模型</p>
<p>6.怎么设计上传word文档，pdf文档功能</p>
<p>7.知道Session共享吗</p>
<h5 id="三面-4"><a href="#三面-4" class="headerlink" title="三面"></a>三面</h5><p>1.问了怎么学习，期待的工作环境</p>
<p>2.做的有成就感的事</p>

        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2020-07-01T13:44:58.282Z" itemprop="dateUpdated">2020-07-01 21:44:58</time>
</span><br>


        
        原文链接：<a href="/2020/07/01/后端开发面试分享/" target="_blank" rel="external">https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/</a>
        
    </div>
    
    <footer>
        <a href="https://lvshen9.gitee.io">
            <img src="/img/avatar.jpg" alt="我的技术小房间">
            我的技术小房间
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            

            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/&title=《后端开发面试分享》 — Lvshen's Blog&pic=https://lvshen9.gitee.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/&title=《后端开发面试分享》 — Lvshen's Blog&source=前段时间面试了几家公司，现在把面试经历写出来。和大家一起分享。为了隐私，面试公司打码。

                
               ..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《后端开发面试分享》 — Lvshen's Blog&url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/&via=https://lvshen9.gitee.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between flex-row-reverse">
  

  
    <div class="waves-block waves-effect next">
      <a href="/2020/05/24/1/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">我在github上的Java项目</h4>
      </a>
    </div>
  
</nav>



    











    <!-- Valine Comments -->
    <div class="comments vcomment" id="comments"></div>
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
    <script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
    <!-- Valine Comments script -->
    <script>
        var GUEST_INFO = ['nick','mail','link'];
        var guest_info = 'nick,mail,link'.split(',').filter(function(item){
          return GUEST_INFO.indexOf(item) > -1
        });
        new Valine({
            el: '#comments',
            notify: 'false' == 'true',
            verify: 'false' == 'true',
            appId: "dy9kXHwg5jQUlLryQmpjWRlM-gzGzoHsz",
            appKey: "P9Nh39Ol0JbMMiYqNGHEP3ml",
            avatar: "mm",
            placeholder: "Just go go",
            guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
            pageSize: "10"
        })
    </script>
    <!-- Valine Comments end -->







</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢大爷~
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="https://lvshen9.github.io/blog2/pay/weixin.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="https://lvshen9.github.io/blog2/pay/weixin.jpg" data-alipay="https://lvshen9.github.io/blog2/pay/zhifu.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>我的技术小房间 &copy; 2015 - 2020</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/&title=《后端开发面试分享》 — Lvshen's Blog&pic=https://lvshen9.gitee.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/&title=《后端开发面试分享》 — Lvshen's Blog&source=前段时间面试了几家公司，现在把面试经历写出来。和大家一起分享。为了隐私，面试公司打码。

                
               ..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《后端开发面试分享》 — Lvshen's Blog&url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/&via=https://lvshen9.gitee.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=https://lvshen9.gitee.io/2020/07/01/后端开发面试分享/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
